;(function () {
	$("div.widget-imgnews-loadingbar").hide();
	var widget = $("div.widget-imgnews").show();
	var imgTable = widget.find("table.img-table");
	
	function adjust(slideValue) {
		widget.width(widget.parents("div.widget:first").innerWidth() - 10);
		imgTable.css({
			marginLeft: (imgTable.outerWidth() - widget.innerWidth()) * ( slideValue / 100 ) * -1 + "px"
		});
	};
	
	var slider = $("div.line");
	
	slider.slider({
		max: 100,
		value: 0,
		slide: function (event, ui) {
			adjust(ui.value);
		}
	});
	adjust();
	$(window).bind("resize", function () {
		adjust(slider.slider("value"));
	});
})();